Conversation
Modified src/signals/internal/filestat/filestat.go: - Added containsAtWordBoundary() function that checks if a substring appears bounded by delimiters (-, _, ., space) or string edges - Added isDelimiter() helper function - Changed substring matching to use word-boundary awareness - Added "production" as an explicit pattern (since "prod" in "production" isn't at a word boundary) Updated src/signals/internal/filestat/filestat_test.go: - Expanded TestMatchFile_Substrings with cases that should and shouldn't match - Added TestContainsAtWordBoundary and TestIsDelimiter unit tests Behavior: | Filename | Before | After | |---------------------|---------|------------| | prod-data.csv | ✓ match | ✓ match | | production-dump.sql | ✓ match | ✓ match | | my-product.csv | ✓ match | ✗ no match | | produce-list.txt | ✓ match | ✗ no match | | prodded-users.csv | ✓ match | ✗ no match |
Supports Terminal.app, iTerm2, and Ghostty
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #50 +/- ##
==========================================
- Coverage 87.47% 86.80% -0.68%
==========================================
Files 60 61 +1
Lines 4040 4144 +104
==========================================
+ Hits 3534 3597 +63
- Misses 360 399 +39
- Partials 146 148 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new security signal that detects when macOS terminal applications (Terminal.app, iTerm2, or Ghostty) are running without Secure Keyboard Entry enabled, which could allow keyloggers to intercept sensitive input like passwords and API tokens.
Key Changes:
- Adds a new
SecureKeyboardSignalthat checks if terminal apps have Secure Keyboard Entry disabled - Enhances file pattern matching with word-boundary awareness to prevent false positives (e.g., "prod" no longer matches "product")
- Includes comprehensive test coverage and detailed security documentation
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/signals/secure_keyboard.go | Implements the SecureKeyboardSignal with process enumeration and plist reading to detect insecure terminal configurations on macOS |
| src/signals/secure_keyboard_test.go | Provides comprehensive test coverage with 20+ test cases covering edge cases, error handling, context cancellation, and plist parsing scenarios |
| src/signals/registry.go | Registers the new SecureKeyboardSignal in the global signal registry |
| src/signals/internal/filestat/filestat.go | Adds word-boundary matching logic to prevent "prod" from incorrectly matching "product", "produce", etc. |
| src/signals/internal/filestat/filestat_test.go | Adds extensive test coverage for the new word-boundary matching functionality |
| go.mod | Adds dependencies for process enumeration (mitchellh/go-ps) and plist parsing (howett.net/plist) |
| go.sum | Updates dependency checksums for the new packages |
| docs/signals/secure_keyboard.md | Provides comprehensive documentation explaining the security risk, remediation steps, and best practices for Secure Keyboard Entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.